package org.one.afternoon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.one.afternoon.domain.Mine;
import org.one.afternoon.domain.Movie;

import java.util.List;

@Mapper
public interface MineMapper extends BaseMapper<Mine>{
    //查找某位特定用户
    @Select("SELECT *\n" +
            "FROM movie \n" +
            "WHERE title IN\n" +
            "(SELECT title\n" +
            "FROM mine\n" +
            "WHERE type =#{item.type} AND phone=#{item.phone})")
    List<Movie> findMines(@Param("item") Mine mine);
}
